<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
  <!--<script src="http://{$Think.config.google_map_url}" async="async"></script>-->
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
  <style>

    .xinxi li{
     min-height:40px ;
      line-height: 40px;
      margin: 2.5px 0;
      background: #fff;
      border-radius: 5px;
      padding: 0 10px;
    }
    .count{
      background: #fff;
      padding: 10px;
      float: left;
      border-radius: 5px;
      margin: 0 10px 10px 0;
    }
    /*.xinxi{*/
      /*width: 80%;*/
    /*}*/
    .img{
      /*padding-left:45px ;*/
      padding: 15px 0 15px 60px;
    }


  </style>
</head>
<body>
<div style="margin-top: 20px;">
</div>

<div class="layui-tab">
        <ul class="layui-tab-title">
          <li class="layui-this">个人信息</li>
          <li>订单信息</li>
          <li>佣金提现</li>
        </ul>
        <div class="layui-tab-content" style="background: #f3efef">
          <!--个人信息-->
          <div class="layui-tab-item layui-show" style="overflow-y:scroll;width: 688px;height: 480px ">
            <ul class="xinxi layui-container">
              <li>会员昵称：{$member.member_nickname}</li>
              <li>会员头像：<p class="img">{if !empty($member.attachment.filepath)}<img width="130px" height="130px" src="{$member.attachment.filepath}" alt="">{/if}</p></li>
              <li>会员等级：{$member.member_type.type_name}</li>
              <li>所在城市：{$member.member_city}</li>
              <li>会员手机：{$member.member_phone}</li>
              <li>会员邮箱：{$member.member_email}</li>
              <li>会员佣金：{$member.member_money}</li>
              <li>会员积分：{$member.member_integral}</li>
              <li>会员创建时间：{$member.creattime|date="Y-m-d H:i:s",###}</li>
            </ul>



          </div>
          <!--个人信息结束-->

          <!--订单信息开始-->
          <div class="layui-tab-item" style="overflow-y:scroll;width: 688px;height: 480px ">
            <table class="layui-table" lay-even="" lay-skin="row" lay-size="sm">
              <colgroup>
                <col width="20%">
                <col width="30%">
                <col width="20%">
                <col width="20%">
                <col width="10%">
              </colgroup>

              <?php if( empty($order)){

              echo '<p>当前没有数据</p>';
              }else{ ?>
              <div>
                <ul class="">
                  <li class="count">
                    <div>已完成订单共 <span style="color: #FF4E42">{$tongji['yiwancheng']}</span>  单</div>
                    <div>总金额：<span style="color: #FF4E42"><b>{$tongji['yiwanchengq']}</b></span> 元</div>
                  </li>
                  <li class="count">
                    <div>未完成订单共 <span style="color: #FF4E42">{$tongji['weiwancheng']}</span>  单</div>
                    <div>总金额：<span style="color: #FF4E42"><b>{$tongji['weiwanchengq']}</b></span> 元</div>
                  </li>
                  <li class="count">
                    <div>已退款订单共 <span style="color: #FF4E42">{$tongji['tuikuan']}</span>  单</div>
                    <div>退款总金额：<span style="color: #FF4E42"><b>{$tongji['tuikuanq']}</b></span> 元</div>
                  </li>

                  <li class="count">
                    <div>已删除订单共 <span style="color: #FF4E42">{$tongji['isdelete']}</span>  单</div>
                    <div>总金额：<span style="color: #FF4E42"><b>-----</b></span> 元</div>
                  </li>
                </ul>
              </div>

              <thead>
              <tr>
                <th>订单编号</th>
                <th>商品名称</th>
                <th>下单时间</th>
                <th>价格</th>
                <th>状态</th>
              </tr>
              </thead>
              <tbody id="order">
              </tbody>

              <?php } ?>
            </table>

            <?php if(!empty($order)){
?>
            <div id="test1"></div>
            <?php  } ?>


          </div>
          <!--订单信息结束-->


          <!--佣金开始-->
          <div class="layui-tab-item">

            <table class="layui-table" lay-even="" lay-skin="row" lay-size="sm">
              <colgroup>
                <col width="20%">
                <col width="20%">
                <col width="20%">
                <col width="20%">
                <col width="20%">
              </colgroup>

              <?php if( empty($tixian)){

              echo '<p>当前没有数据</p>';
              }else{ ?>
              <thead>
              <tr>
                <th>金额</th>
                <th>操作</th>
                <th>时间</th>
                <th>来源</th>
                <th>状态</th>
              </tr>
              </thead>
              <tbody id="tixian">
              </tbody>

              <?php } ?>
            </table>

            <?php if(!empty($tixian)){
?>
            <div id="test2"></div>


            <?php  } ?>



          </div>
        </div>
  <!--佣金结束-->

</div>





<script src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>

<script>
  layui.use(['layer', 'form','laydate','element','laypage'], function() {
      // var laydate = layui.laydate;
    var layer = layui.layer,
            $ = layui.jquery,
        laydate= layui.laydate,
            form = layui.form,
          element = layui.element,
        laypage = layui.laypage;
        var order= eval(<?php echo json_encode($order); ?>)
        var tixian= eval(<?php echo json_encode($tixian); ?>)
      laypage.render({
          elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
          ,count: order.length //数据总数，从服务端得到
          ,jump: function(obj,first){
              //obj包含了当前分页的所有参数，比如：
              // console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
              // console.log(obj.limit); //得到每页显示的条数
              var arr = []
              var   zong=obj.curr*obj.limit - obj.limit

              $('#order tr').remove()
              thisData  = order.concat().splice(zong, obj.limit);
              var s='';
                  layui.each(thisData , function(index, item){
                      s+='<tr>';
                      s+='<td>'+item.order_no+'</td>';
                      s+='<td><div>'+item.goods_name+'</div></td>';
                      var date=item.creattime*1000;
                      s+='<td>'+ getMyDate(date)+'</td>';

                      if (item.fold_money===null) {

                          s+='<td><span style="color: #FF4E42"><b>0</b></span></td>';
                      }else {
                          s+='<td><span style="color: #FF4E42"><b>'+item.fold_money+'</b></span></td>';
                  }
                      switch(item.isdelete){
                          case 0:
                              switch(item.order_status)
                              {
                                  case '1':
                                      s+='<td>待付款</td>';
                                      break;
                                  case '2':
                                      s+='<td>待使用</td>';
                                      break;
                                  case '3':
                                      s+='<td>待评价</td>';
                                      break;
                                  case '4':
                                      s+='<td>已评价</td>';
                                      break;
                                  case '5':
                                      s+='<td>退款申请中</td>';
                                      break;
                                  case '6':
                                      s+='<td>已取消</td>';
                                      break;
                                  case '7':
                                      s+='<td>已过期</td>';
                                      break;
                                  case '8':
                                      s+='<td>已退款</td>';
                                      break;
                                  case '9':

                                      break;
                                  default:
                                      s+='<td>1</td>';
                              }
                              break;
                          case 1:
                              s+='<td>已删除</td>';
                              break;
                          default:
                              s+='<td>2</td>';

                  }


                      s+='</tr>';
                  });
      $('#order').append(s)

              //首次不执行
              if(!first){
                  //do something
              }
          }
      });
      laypage.render({
          elem: 'test2' //注意，这里的 test1 是 ID，不用加 # 号
          ,count: tixian.length //数据总数，从服务端得到
          ,jump: function(obj,first){
              //obj包含了当前分页的所有参数，比如：
              // console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
              // console.log(obj.limit); //得到每页显示的条数
              var arr = []
              var   zong=obj.curr*obj.limit - obj.limit

              $('#tixian tr').remove()
              thisData  = tixian.concat().splice(zong, obj.limit);
              var s='';
              layui.each(thisData , function(index, item){
                  s+='<tr>';
                  switch(item.tis){
                      case 1:
                          s+='<td><span style="color: #FF4E42"><b>-'+item.money+'</b></span></td>';
                          break;
                      case 2:
                          s+='<td><span style="color: #FF4E42"><b>+'+item.money+'</b></span></td>';
                          break;
                      default:
                  }



                  s+='<td><div>'+item.tishi+'</div></td>';
                  var date=item.time;
                  s+='<td>'+ date+'</td>';

                  var order_date = item.order_name;
                  s+='<td>'+ order_date+'</td>';
                  // 申请状态 1= 申请中 2= 已处理 3 = 已拒绝
                  switch(item.state){
                      case '1':
                          s+='<td style="color: red">申请提现中</td>';
                          break;
                      case '2':
                          s+='<td style="color: green">提现成功</td>';
                          break;
                      case '3':
                          s+='<td style="color: #FFB800">已拒绝提现</td>';
                          break;
                      case 6:
                          s+='<td style="color: blue">获得佣金</td>';
                          break;
                      default:
                          s+='<td>未知</td>';

                  }

                  s+='</tr>';
              });
              $('#tixian').append(s)
              //首次不执行
              if(!first){
                  //do something
              }
          }
      });
  });

  function getMyDate(str){
      var oDate = new Date(str),
          oYear = oDate.getFullYear(),
          oMonth = oDate.getMonth()+1,
          oDay = oDate.getDate(),
          oHour = oDate.getHours(),
          oMin = oDate.getMinutes(),
          oSen = oDate.getSeconds(),
          oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +' '+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间
      return oTime;
  };
  //补0操作
  function getzf(num){
      if(parseInt(num) < 10){
          num = '0'+num;
      }
      return num;
  }

</script>


<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">

</script>
</body>
</html>
